<?php
  // Load SO  
  $inicial = preg_split('/ /', exec('bash ../script/main.sh'));

  $server = $inicial[1];
  
  // Reiceving commands
  $command = isset($_GET['cmd']) ? $_GET['cmd'] : null;
  //
  $output = "Teste"; 

?>
<DOCTYPE html>
<html>
  <head>
    <title>Shelllost</title>
    <meta charset="utf-8"/>
  </head>
  <body>
    <h1>Welcome to reversing shell</h1>
    <form method='get' action='#'>
      <input type='text' style='' name='cmd' placeholder='type command, like: ls'/>
      <input type='text' name='server' placeholder='servodor' value='<?= $server ?>'/>
      <input type='submit'/>
    </form>

    <div id=out>
      <pre><?= $output ?></pre>
    </div>
  </body>
</html>
